﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using tuwien.auto.eibclient;

namespace KNXFramework.KNXObjects.ValueObjects
{
    internal class U8ObjectValue : UIntObjectValue
    {
        public U8ObjectValue()
        {

        }
        public U8ObjectValue(string value) : base(value)
        {
            if (m_Value > 255)
                throw new ApplicationException("ByteObjectValue: Value must be contained between 0 and 255. Val : " + value);
        }
        public U8ObjectValue(EIBBuffer buffer)
        {
            if (buffer.data.Length == 2)
                m_Value = Convert.ToUInt32(buffer.data[1] & 0x3f);
            else
                m_Value = buffer.data[2];
        }
    }
}
